package com.lxw.hi_mvp_mvvm.scene1_mvp;

import android.os.Build;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import com.lxw.hi_mvp_mvvm.User;

/**
 * @authour
 * @function 直接使用
 * @date 2021/4/16
 */
public class scene1Activity extends AppCompatActivity implements HomeContract.View {

    private HomePresenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter = new HomePresenter();
        presenter.attach(this);
    }

    @Override
    public void onGetUserInfoResult(User user, String errorMsg) {

    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    @Override
    public boolean isAlive() {
        return !isDestroyed() && !isFinishing();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        presenter.detach();
    }
}
